package com.universal.frame.views;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;

/**
 * 云码科技.All rights reserved
 *
 * @author LuoXiang
 * @ClassName CustomViewPager
 * @TitleName CustomViewPager
 * @Data 2016-9-7 上午9:05:51
 */
public class CustomViewPager extends ViewPager {

    private boolean isCanScroll = true;

    /**
     * @return the isCanScroll
     */
    public boolean isCanScroll() {
        return isCanScroll;
    }


    public void setCanScroll(boolean isCanScroll) {
        this.isCanScroll = isCanScroll;
    }

    public CustomViewPager(Context context) {
        super(context);
    }

    public CustomViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }


    @Override
    public void scrollTo(int x, int y) {
        if (isCanScroll) {
            super.scrollTo(x, y);
        }
    }
}
